<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('资产列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>资产名称：</label>
                                <input type="text" name="assetsName"/>
                            </li>
                            <li>
                                <label>资产类别：</label>
                                <select name="assetsType" th:with="type=${@dict.getType('assets_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>规格型号：</label>
                                <input type="text" name="assetsModel"/>
                            </li>
                            <li>
                                <label>SN号：</label>
                                <input type="text" name="assetsSn"/>
                            </li>
                            <li>
                                <label>设备状态：</label>
                                <select name="assetsStatus" th:with="type=${@dict.getType('assets_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>资产编号：</label>
                                <input type="text" name="id"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('assets:assets:edit')}]];
        var removeFlag = [[${@permission.hasPermi('assets:assets:remove')}]];
        var assetsTypeDatas = [[${@dict.getType('assets_type')}]];
        var assetsAreaDatas = [[${@dict.getType('area_type')}]];
        var assetsCompanyDatas = [[${@dict.getType('company')}]];
        var assetsStatusDatas = [[${@dict.getType('assets_status')}]];
        var prefix = ctx + "assets/presion";

        $(function() {
            var options = {
                url: prefix + "/listSearch",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "资产",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '资产编号',
                    visible: false
                },
                {
                    field: 'assetsName',
                    title: '资产名称'
                },
                {
                    field: 'assetsType',
                    title: '资产类别',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(assetsTypeDatas, value);
                    }
                },
                {
                    field: 'assetsModel',
                    title: '规格型号'
                },
                {
                    field: 'assetsSn',
                    title: 'SN号'
                },
                {
                    field: 'assetsArea',
                    title: '所属部门',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(assetsAreaDatas, value);
                    }
                },
                {
                    field: 'assetsCompany',
                    title: '领用人',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(assetsCompanyDatas, value);
                    }
                },
                {
                    field: 'assetsStatus',
                    title: '设备状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(assetsStatusDatas, value);
                    }
                }
//                    ,
//                    {
//                        field: 'createTime',
//                        title: '入库日期'
//                    }
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>